package service

import "time"

type Options struct {
	Port             int
	LoginTimeout     time.Duration `json:"loginTimeout"`
	PingPongInterval time.Duration `json:"pingPongInterval"`
	HandlerTimeout   time.Duration `json:"handlerTimeout"`
	WorkerPoolSize   int           `json:"workerPoolSize"`
}

type OptFunc func(s Engine)

type AuthProvider func(user, pass string) error

func WithAuthProvider(authProvider AuthProvider) OptFunc {
	return func(s Engine) {
		f, ok := s.(*ServiceImp)
		if ok {
			f.authProvider = authProvider
		}
	}
}
